<template>
	<!-- 商品 -->
	<view class="goods-item-container">
		<!-- 商品封面 -->
		<image class="goods-cover" src="/static/images/goods.png" mode="aspectFill" />
		<!-- 商品信息 -->
		<view class="goods-info">
			<view class="name">芒果柠檬茶</view>
			<view class="desc">规格：600ml</view>
			<view class="price">
				<view class="unit">¥</view>
				<view>15</view>
			</view>
		</view>
		<!-- 加入购物车 -->
		<view class="add">
			<text>选规格</text>
		</view>
	</view>
</template>

<script>
import { defineComponent } from 'vue';

export default defineComponent({
	name: 'GoodsItem',
	setup() {},
});
</script>

<style lang="scss" scoped>
// 商品
.goods-item-container {
	display: flex;
	position: relative;
	align-items: center;

	// 商品封面
	.goods-cover {
		width: 148rpx;
		height: 160rpx;
	}

	// 商品信息
	.goods-info {
		.name {
			color: #3b3b3b;
			font-size: 30rpx;
			font-weight: bold;
		}

		.desc {
			color: #b3b3b3;
			font-size: 20rpx;
			margin-top: 12rpx;
		}

		.price {
			display: flex;
			color: #000000;
			font-size: 40rpx;
			align-items: baseline;
			margin-top: 16rpx;

			.unit {
				font-size: 24rpx;
			}
		}
	}

	// 加入购物车
	.add {
		right: 0;
		color: #fff;
		bottom: 2rpx;
		width: 120rpx;
		height: 48rpx;
		font-size: 22rpx;
		line-height: 48rpx;
		text-align: center;
		position: absolute;
		border-radius: 48rpx;
		background-color: $primary-color;
	}
}
</style>
